package com.zcxy.sys.pojo;

import com.zcxy.mybatis.bean.SysUser;
import com.zcxy.mybatis.util.anotation.InverseJoinColumn;
import com.zcxy.mybatis.util.anotation.JoinColumn;
import com.zcxy.mybatis.util.anotation.JoinTable;
import com.zcxy.mybatis.util.anotation.ManyToMany;
import com.zcxy.sys.entity.SysRoleUser;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 角色
 *
 * @author zcc
 * @email 860474958@qq.com
 * @date 2020-06-02
 */
@Data
@ApiModel(value = "SysRoleVo", description = "角色实体对象")
public class SysRoleVo {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    private String id;

    @ApiModelProperty(value = "角色名称", required = false)
    private String roleName;

    @ApiModelProperty(value = "描述", required = false)
    private String description;

    @ApiModelProperty(value = "启用(0未启用1启用)", required = false)
    private String status;

    @ApiModelProperty(value = "全部工作区（0非全工作区，1全工作区）", required = false)
    private String usedAllworkspace;


    @ApiModelProperty(value = "唯一编码", required = false)
    private String code;


    @ApiModelProperty(value = "用户集合", required = false, hidden = true)
    @ManyToMany
    @JoinTable(entityClass = SysRoleUser.class)
    @JoinColumn(name = "id", referencedColumnName = "role_id")
    @InverseJoinColumn(name = "user_id", referencedColumnName = "id")
    private List<SysUser> users;


    @ApiModelProperty(value = "用户id集合", required = false)
    private List<String> userIds;

    @ApiModelProperty(value = "用户组id集合", required = false)
    private List<String> userGroupIds;

}
